<style type="text/css">
    .b{
        border-bottom: 1px solid #f6f6f6;
        border-width: 1px;
        border-style: solid;
        border-color: #e6e6e6;
    }
    .layui-inline{
        margin: 5px
    }
    .layui-form-label{
        width: 140px;
    }
</style>
<div class="layui-fluid">
<div class="layui-breadcrumb jy-breadcrumb">

</div>
<div id ='view'></div>
<script id="page1" type="text/html">
<div class="layui-card">
    <div class="layui-card-header">
        <span style="padding: 20px;font-size:20px;color:#ADADAD">
            <b>基本信息</b>
        </span>
        <span style="float:right;padding: 0px 100px 0px 0px">
            {{# if(d.audit_status==1){ }}
            <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id='audit'>审 核</button>
            {{# }}}
            <a class="layui-btn layui-btn-normal layui-btn-sm" href="/#/Newproductaudit/auditList#4" >返 回</a>
        </span>
    </div>
    <div class="layui-row layui-col-space15" >
      <div class="layui-col-md8 ">
        <div class="layui-row grid-demo">
          <div class="layui-col-md12">
            <div class="layui-inline">
                <label class="layui-form-label">SKU：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.sku||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">采购名称：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.name||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">长（打包前mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.aslength||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">长（打包后mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.aslength||''}}" disabled="true">
                </div>
            </div>
                        <div class="layui-inline">
                <label class="layui-form-label">宽（打包前mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.aswide||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">宽（打包后mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.aswide||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">高（打包前mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.ashight||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">高（打包后mm）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.ashight||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">重量（打包前g）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.asweight||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">重量（打包后g）：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.baleweight||''}}" disabled="true">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">容量：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="{{d.bulk||''}}" disabled="true" style="width:80px">
                  <input type="text" class="layui-input" value="{{d.bulk_unit||''}}" disabled="true" style="width:40px">
                </div>
            </div>
            <div class="layui-card-header">
                <span style="padding: 20px;font-size:20px;color:#ADADAD">
                    <b>标题</b>
                </span>
            </div>
            <div class="layui-item">
                <div class="layui-input-block" style="padding: 10px">
                    {{d.title||''}}
                </div>
            </div>
            <div class="layui-card-header">
                <span style="padding: 20px;font-size:20px;color:#ADADAD">
                    <b>描述</b>
                </span>
            </div>
            <div class="layui-item">
                <div class="layui-input-block">
                    {{d.description||''}}
                </div>
            </div>
            <div class="layui-card-header">
                <span style="padding: 20px;font-size:20px;color:#ADADAD">
                    <b>产品属性</b>
                </span>
            </div>
            <div class="layui-item">
                <div class="layui-input-block">
                    {{d.productattr||''}}
                </div>
            </div>
            <div class="layui-card-header">
                <span style="padding: 20px;font-size:20px;color:#ADADAD">
                    <b>多属性</b>
                </span>
            </div>
            <div class="layui-item">
                <div class="layui-input-block" >
                    color：{{d.color||''}}<br/>
                    type：{{d.type||''}}<br/>
                    shape：{{d.shape||''}}<br/>
                    size：{{d.size||''}}<br/>
                    pattern：{{d.pattern||''}}
                </div>
            </div>
          </div>
        </div>
      </div>
      <!-- style="position: fixed;right: 0;width: 26%;" -->
      <div class="layui-col-md4"  >
        <div class="layui-row grid-demo grid-demo-bg1">
          <div class="layui-col-md12" style="padding: 0px 0px 0px 20px">
            <div class="layui-item">
                SKU：{{d.sku||''}}
            </div>
            <div class="layui-item">
                SPU：{{d.spu||''}}
            </div>
            <div class="layui-item">
                采购名称：{{d.name||''}}
            </div>
            <div class="layui-item">
                制作类型：{{d.production_type||''}}
            </div>
            <div class="layui-item">
                是否授权：{{d.authorization||''}}
            </div>
            <div class="layui-item">
                品牌Logo：{{d.logo||''}}
            </div>
            <div class="layui-item">
                打包前尺寸：{{d.aslength+'*'+d.aswide+'*'+d.ashight||''}}
            </div>
            <div class="layui-item">
                数量单位：{{d.quantity_unit||''}}
            </div>
            <div class="layui-item">
                调研链接：<a class="blue" href="{{d.research_links||''}}" target="_blank">点击跳转</a>
            </div>
            <div class="layui-item">
                开发链接：<a class="blue" href="{{d.develop_link||''}}" target="_blank">点击跳转</a>
            </div>
            <div class="layui-item">
                开发备注：{{d.remarks||''}}
            </div>
            <div class="layui-item">
                仿品（具体品牌）：{{d.imitation||''}}
            </div>
            <div class="layui-item">
                盗图/实拍图：{{d.realpic||''}}
            </div>
          </div>
        </div>
      </div>
    </div>
</div>
</script>
</div>
<script>
    layui.use(['admin', 'table', 'form', 'toolJ', 'formSelects', 'laydate', 'laytpl','upload'], function () {
        var $ = layui.$
            , admin = layui.admin
            , view = layui.view
            , table = layui.table
            , laytpl = layui.laytpl
            , upload = layui.upload
            , laydate = layui.laydate
            , formSelects = layui.formSelects
            , toolJ = layui.toolJ
            , form = layui.form;
        var id = layui.router().search.id;

        toolJ.ajax({"data": {"id": id}, "type": "get", url: "/index/Datamanufacture/skuDetails"},
            function (data) {
                var getTpl = page1.innerHTML, 
                    view = $('#view');
                laytpl(getTpl).render(data.data, function (html) {
                    view.html(html);
                });
            }
        );

        $('#view').on('click','#audit',function () {
            layer.open({
                type: 1
                ,title: '审核'
                // ,closeBtn: false
                ,area: ['600px', '260px']
                ,shade: 0.8
                ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                ,btn: ['保存','取消']
                ,btn1: function(index, layero){
                    var status = $("input[name=status]:radio:checked").val();
                    var remarks = $("input[name=remarks]").val();
                    $.ajax({
                        type: 'POST',
                        url: '/index/Newproductaudit/updateMaterialAudit',
                        dataType: 'json',
                        data: {status:status,remarks:remarks,id:id,type:'edit'},
                        success: function (data) {
                            layer.close(index1);
                            if (data.code == 1) {
                                if (data.msg) {
                                    layer.msg(data.msg, {"icon": 1});
                                }
                                layer.closeAll();
                                var url = window.location.toString();
                                location = url.split('#')[0]+'#/Newproductaudit/auditList#4';
                            } else {
                                layer.alert(data.msg, {"icon": 2});
                                return false;
                            }                                       
                        },
                        error: function () {
                            layer.close(index1);
                            layer.alert('系统繁忙,请稍后再试!', {"icon": 2});
                            return false;
                        },
                        beforeSend: function () {
                            index1=layer.load(2, {
                                shade: [0.5, '#fff']
                            });
                        }
                    });

                    return false;
                }
                ,content: '<div class="layui-card layui-form" lay-filter="LAY-list-form1"><div class="layui-form-item"><label class="layui-form-label">审核：</label><div class="layui-input-block"><input type="radio" name="status" value="2" title="通过" checked=""><input type="radio" name="status" value="3" title="驳回"></div></div><div class="layui-inline"><label class="layui-form-label">备注：</label><div class="layui-input-block" style="padding: 0px 0px 10px 0px"><input type="text" name="remarks" autocomplete="off" placeholder="" class="layui-input" style="width:400px"></div></div></div>'
                ,success: function(layero){
                    form.render(null, 'LAY-list-form1');
                }
            });
        });
    });
</script>